package com.dj.msgtable.commom;

import com.dj.msgtable.service.CustomService;
import com.dj.msgtable.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;


@Component
public class Quarzt {
    @Autowired
    UserService userService;
    @Autowired
    CustomService customService;

    //    @Scheduled(cron = "*/5 * * * * ?")
    @Scheduled(cron = "0 0 1 * * ?")
    public void excute() {
        userService.dailyWork();
        System.out.println("定时任务清理每日插入成功");
    }

//    @Scheduled(cron = "*/1 * * * * ?")
//    public void excute1() {
//        long tmp = new Date().getTime() / 1000;
//        long time = 1589904000;
//        if (tmp > time) {
//            customService.deleteCus();
//        }
//    }

}